package com.lagou.task18;

public class MultiThreadTest {
    public static void main(String[] args) {
//        new Thread(()->{}).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                // 获取1-100之间的奇数
                for (int i = 1; i < 100; i++) {
                    if ((i % 2) != 0) System.out.println("奇数= " + i);
                }
            }
        }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                //获取1-100之间的偶数
                for (int i = 1; i < 100; i++) {
                    if ((i % 2) == 0) System.out.println("偶数= " + i);
                }

            }
        }).start();

        System.out.println("终于都执行完了");
    }
}
